17. Tests in Maven

Tests in Maven

ND079 JPND C3 L4 A13 Tests In Maven

Unit Testing Saves Time

Studies by the National Institute of Standards and Technology as well as by IBM have attempted to assess the cost of fixing bugs depending on where they are discovered during the implementation process. In both cases, the cost of defects was dramatically higher the later in the process they are discovered.

NIST report (pdf)

IBM - Integrating Software Assurance into the SDLC

Unit Tests in Maven

As we learned in Maven unit, our tests will run whenever any phases later than the test phase are reached, which means any time the project is compiled or packaged. Additionally, you can add the results of your unit tests to the site report generated by mvn site. This is accomplished by adding the surefire-report plugin to your <reports> tag in your pom.xml.